<?php

use App\Http\Controllers\Customer\Index;
use App\Http\Controllers\Customer\Order;
use App\Http\Controllers\Admin\Transport\Order as OrderTransport;
use App\Http\Controllers\Customer\Abnormal;
use App\Http\Controllers\Customer\Problem;
use App\Http\Controllers\Customer\Compensate;
use App\Http\Controllers\Customer\Country;
use App\Http\Controllers\Customer\PreTake;
use App\Http\Controllers\Customer\Dashboard;
use App\Http\Controllers\Customer\Msg;
use App\Http\Controllers\Customer\Account;
use App\Http\Controllers\Customer\Currency;
use App\Http\Controllers\Customer\Recbill;
use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Admin\Dictionary;
use App\Http\Controllers\Customer\Price;


/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::post('/register', [Index::class, 'register']);
Route::post('/login', [Index::class, 'login_password']);
Route::post('/code/login', [Index::class, 'login_code']);
Route::post('/send/sms', [Index::class, 'sendSms']);
Route::get('/info', [Index::class, 'info']);
Route::post('/code/check', [Index::class, 'check_code']);
Route::post('/avatar', [Account::class, 'avatar']);

Route::get('/address', [Country::class, 'index']);
Route::get('/country', [Country::class, 'country']);
Route::post('/upload', [Index::class, 'upload']);
Route::get('/airports', [Country::class, 'airports']);
Route::get('/destination', [Country::class, 'destination']);

Route::get('/dashboard', [Dashboard::class, 'index']);

//字典
Route::get('/dic/type', [Dictionary::class, 'types']);
Route::get('/dics', [Dictionary::class, 'list']);
Route::post('/dic', [Dictionary::class, 'add']);
Route::put('/dic/{id}', [Dictionary::class, 'update']);
Route::delete('/dic/{id}', [Dictionary::class, 'del']);

//===========下单==========
    Route::get('/orders', [Order::class, 'list']);
    Route::get('/order/{id}', [Order::class, 'detail']);
    Route::post('/preorder', [Order::class, 'preorder']);
    Route::post('/order/confirm', [Order::class, 'confirm']);
    Route::post('/order/abnormal', [Abnormal::class, 'add']);
    Route::post('/order/abnormal/cancel', [Order::class, 'abnormal_cancel']);
    Route::post('/order/export', [Order::class, 'export']);
//    Route::post('/order/import', [Order::class, 'import']);
    Route::post('/order/import', [Order::class, 'import']);
    Route::post('/order/pdf', [Order::class, 'pdf']);
    Route::get('/pdf', [Order::class, 'pdf_test']);

    //异常件列表
    Route::get('/abnormal', [Abnormal::class, 'list']);
    Route::delete('/abnormal/{id}', [Abnormal::class, 'delete']);
    Route::get('/abnormal/detail', [Abnormal::class, 'detail']);

    //问题件列表
    Route::get('/problem', [Problem::class, 'list']);
    Route::put('/problem/reply/{id}', [Problem::class, 'reply']);
    Route::post('/problem/compensate', [Problem::class, 'compensate']);
    Route::put('/problem/handle/{id}', [Problem::class, 'handle']);
    Route::get('/problem/detail', [Problem::class, 'detail']);
    Route::get('/problem/type', [Problem::class, 'type']);

    //赔偿列表
    Route::get('/compensate', [Compensate::class, 'list']);
    Route::get('/compensate/detail', [Compensate::class, 'detail']);
    Route::post('/compensate/apply', [Compensate::class, 'apply']);
    Route::post('/compensate/info', [Compensate::class, 'info']);

    //账单列表
    Route::get('/recbills', [Recbill::class, 'list']);
    Route::post('/recbills/confirm', [Recbill::class, 'confirm']);
    Route::post('/recbills/reject', [Recbill::class, 'reject']);
    Route::get('/recbill/detail', [Recbill::class, 'detail']);
    Route::get('/recbill/export', [Recbill::class, 'export']);
//    Route::get('/recbill/invoices', [Recbill::class, 'invoices']);
//    Route::put('/recbill/confirm/id/{id}', [Recbill::class, 'confirm']);
//    Route::put('/recbill/reject/id/{id}', [Recbill::class, 'reject']);
    Route::put('/recbill/pay/id/{id}', [Recbill::class, 'pay']);
//    Route::get('/recbill/id/{id}', [Recbill::class, 'detail']);
//    Route::get('/recbill/take_order/id/{id}', [Recbill::class, 'take_order_detail']);
//    Route::get('/recbill/order/id/{id}', [Recbill::class, 'order_detail']);

    //取件列表
    Route::get('/pre/take', [PreTake::class, 'list']);
    Route::post('/pre/take', [PreTake::class, 'add']);
    Route::get('/pre/take/detail', [PreTake::class, 'detail']);
    Route::delete('/pre/take/cancel/{id}', [PreTake::class, 'cancel']);

    //价格查询
    Route::post('/price/query', [Order::class, 'price_query']);
    Route::get('/price/query', [Price::class, 'index']);
    Route::get('/warehouse', [Order::class, 'warehouse']);

    //消息通知
    Route::get('/msg', [Msg::class, 'index']);

    //账户资料信息
    Route::get('/account', [Account::class, 'index']);
    Route::post('/account/phone', [Account::class, 'update_phone']);
    Route::post('/account/addr', [Account::class, 'update_addr']);
    Route::post('/account/invoice', [Account::class, 'update_invoice']);
    Route::post('/account/email', [Account::class, 'update_email']);
    Route::post('/account/password', [Account::class, 'update_password']);


    //
    Route::get('/currency', [Currency::class, 'list']);




